<template>
    <div class="xl-table">
        <xlUntil text="项目月度填报列表" :queryParam="queryParam" :filtersVislble="true"  :addBtn="false" :import-btn="false" @delBatch="delBatch"  :searchColumns="columns"  @searchKeyWord="searchKeyWord" @addForm="addForm" :exportXlsData="exportXlsData" :export-xls-url="url.exportXlsUrl"></xlUntil>
        <div class="xl-table-content">
            <xlTable
                    :columns="columns"
                    :dataSource="data"
                    rowKey="id"
                    :pagination="pagination"
                    :loading="loading"
                    @change="handleTableChange"
                    bordered
                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
                >
                <template v-slot:action="scope">
                    
                    <a @click="seeForm(scope.record)" >查看</a> 
                </template>
            </xlTable>
        </div>
        <xlForm :column='2' ref="xlForm" @handleOk="handleOk"></xlForm>
        <seeForm ref="seeForm"></seeForm>
    </div>
</template>

<script>
   
    import xlMixin from '@/components/mixin'
    import seeForm from '@/views/new/month_list/model/see'
    
    export default {
        name: "index",
        mixins:[xlMixin],
        data(){
            return{
                columns:[
                    {
                        title: '编号',
                        key: 'rowIndex',
                        align: "center",
                        fixed: 'left',
                        width:'80px',
                        customRender: function (t, r, index) {
                            return parseInt(index) + 1;
                        }
                    },
                    {
                        title: "新研名称",
                        dataIndex: 'newDevOrgName',
                        type:'input'
                    },
                    {
                        title: "项目名称",
                        dataIndex: 'projectName',
                        type:'input'
                    },
                    {
                        title: '年度',
                        dataIndex: 'year',
                        align: "center",
                        type:'input',
                        formVisible:true,
                    },
                    {
                        title: '月份',
                        dataIndex: 'month',
                        align: "center",
                        type:'input',
                        // typeData: 'month',
                       
                    },
                    {
                        title: '计划投入（万元）',
                        dataIndex: 'planInvestment',
                        type:'input.number'
                    },
                    {
                        title: '实际投入（万元）',
                        dataIndex: 'investment',
                        type:'input.number'
                    },
                   
                    {
                        title: '操作',
                        dataIndex: 'action',
                        align: "center",
                        fixed: 'right',
                        width:'150px',
                        scopedSlots: {customRender: 'action'},
                    }
                ],
                // "1:A.NEW_DEV_ORG_NAME=新型研发机构名称<br/>" +
                // "2:A.PROJECT_NAME=项目名称<br/>" +
                // "3:A.INVESTMENT=实际投入<br/>" +
                // "4:A.PLAN_INVESTMENT=计划投入<br/>" +
                // "5:A.YEAR=年<br/>" +
                // "6:A.MONTH=月"
                exportXlsData:[
                    {
                        title:'新研名称',
                        dataIndex:'C.NEW_DEV_ORG_NAME'
                    },
                    {
                        title:'项目名称',
                        dataIndex:'B.PROJECT_NAME'
                    },
                    {
                        title:'实际投入',
                        dataIndex:'A.INVESTMENT'
                    },
                    {
                        title:'计划投入',
                        dataIndex:'A.PLAN_INVESTMENT'
                    },
                    {
                        title:'年',
                        dataIndex:'A.YEAR'
                    },
                    {
                        title:'月',
                        dataIndex:'A.MONTH'
                    },
                    
                ],

                paramMore:{
                    
                },
               
                // 请求参数
                url: {
                    list: "/ndo/api/ndo/quartely/report/hatch/project/month/investment/pageList",
                    add: '/ndo/api/ndo/quartely/report/company/month/investment/save',
                    edit: '/ndo/api/ndo/hatch/company/hatch/save',
                    delete: "/ndo/api/ndo/hatch/company/move/out",
                    deleteBatch: "/ndo/api/ndo/hatch/company/remove",
                    exportXlsUrl: "/ndo/api/new/dev/org/export/month/project",
                    importExcelUrl: "ndo/api/ndo/hatch/company/importExcel",
                    importExcelDemoUrl:'/ndo/api/ndo/hatch/company/importTemplate'
                }
            }
        },
        created(){
            this.formatMerge()
            this.pageOnload()

        },
        methods:{
            seeForm(data){
                this.$refs.seeForm.formatForm(data,2)
                this.$refs.seeForm.visible = true
            }
        },
        components:{
            seeForm
        }
    }
</script>

<style scoped lang="less">
    table {
        width: 100%;
        font-size: 14px;
            border-collapse: collapse;/*表格样式。如果可能，边框会合并为一个单一的边框。会忽略 border-spacing 和 empty-cells 属性*/
            .tdTitle{
                width:200px;
                height: 40px;
            }
            .tdContent{
                width:250px;
                height: 40px;
            }
        }
 
        td,th{
            border: 1px solid ;
            border-color: #ccc;
            font-size: 12px;
            text-align: center;
            height: 40px;
        }
    .xl-table{
        .xl-table-content{
            padding: 16px;
        }
    }
</style>
